<?php

namespace App\Models\Factory\V0;


use App\Constants\InviteConstant;
use App\Helpers\V0\SLogger;
use App\Models\AbsModelFactory;
use App\Models\Orm\V0\Bankbin;
use App\Services\Core\Store\R360\R360Service;
use SimpleSoftwareIO\QrCode\Facades\QrCode;

/**
 * 生成恒信订单号
 */
class RongFactory extends AbsModelFactory
{
    /**
     * 考拉检测四要素
     *
     * @param int $action_code
     * @return bool|string
     */
    public static function fetchUserKao($infodata)
    {
        $openapiDevBase = new R360Service();

        $bizData = array(
            'phone' => $infodata['phone'],
            'idNumber' => $infodata['idNumber'],
            'name' => $infodata['name'],
            'bankCard' =>$infodata['bankCard']
        );
        $method = 'tianji.api.kaola.bankcard4item';
        $data = $openapiDevBase->tianjiSend($bizData, $method);

        $data = json_encode($data);
        $data = json_decode($data,true);
        dd($data);
    }


    /**
     * 信联检测四要素
     *
     * @param int $action_code
     * @return bool|string
     */
    public static function fetchUserXin($infodata)
    {
        $openapiDevBase = new R360Service();

        $bizData = array(
            'phone' => $infodata['phone'],
            'idNumber' => $infodata['idNumber'],
            'name' => $infodata['name'],
            'bankCard' =>$infodata['bankCard']
        );
        $method = 'tianji.api.xinlian.bankcardCheck4Item';
        $data = $openapiDevBase->tianjiSend($bizData, $method);

        $data = json_encode($data);
        SLogger::getStream()->info('信联开始');
        SLogger::getStream()->info($data);
        SLogger::getStream()->info('信联结束');
//        $data = json_decode($data,true);
//        dd($data);
    }

}